package org.adw.launcher2.ld.secret.ui;

import org.adw.launcher2.R;
import org.adw.launcher2.ld.secret.db.MySMSCache;
import org.adw.launcher2.ld.secret.ui.utils.Global;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;

public class HomeLoadActivity extends Activity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home_load);
		final MySMSCache smsCache = MySMSCache.getInstance(Global.dbHelper);
		Global.cr = getContentResolver();
		AsyncTask<Uri, Void, Void> task = new AsyncTask<Uri, Void, Void>(){
			//TODO:vanloi999 LOAD CAC INFO DE HIEN THI LEN MAIN ACTIVITY
			@Override
			protected Void doInBackground(Uri... params) {
				smsCache.backUpUser(Global.cr);// back user for sms purpose
				return null;
			}
			@Override
			protected void onPostExecute(Void result) {
				startMainActivity();
			}
			
		};
		task.execute();
	}
	protected void startMainActivity() {
		Intent intent  = new Intent(this, MainActivity.class);
		startActivity(intent);
		
	}
	@Override
	protected void onDestroy() {
		super.onDestroy();
	}
}
